package com.shadow.study.quartz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shadow.common.entity.ScheduleJobEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * quartz任务配置的数据操作.
 *
 * @author: Pbody
 * @date: 2021/3/23 10:20
 */
@Mapper
public interface ScheduleJobMapper extends BaseMapper<ScheduleJobEntity> {
    /**
     * 批量更新状态.
     *
     * @param map 参数
     * @return int
     * @author Pbody
     * @date 9:33 2021/6/2
     **/
    int updateBatch(final Map<String, Object> map);

    /**
     * 关联任务日志表的分页查询.
     *
     * @param page   分页对象
     * @param params 入参
     * @return java.util.List
     * @author Pbody
     * @date 9:39 2021/6/2
     **/
    List<ScheduleJobEntity> queryJobAndLogPage(final Page<ScheduleJobEntity> page,
                                               @Param("params") final Map<String, Object> params);
}
